home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / code_lib / objlibr / objlib12 / sample1 / module1.bas < prev    next >
Encoding:
BASIC Source File  |  1995-06-04  |  2.1 KB  |  64 lines

  1. Option Explicit
  2.  
  3. Global Const GWW_HINSTANCE = (-6)
  4. Global Const SRCCOPY = &HCC0020
  5. Global tx%, ty%
  6. Type itemdata
  7.     cap As String           'description
  8.     cline As String         'command line
  9.     dir As String           'working dir
  10.     iconpath As String      '-
  11.     xpos As Integer         'pos in window
  12.     ypos As Integer         'pos in window
  13.     iconindex As Integer    '-
  14.     key As Integer          'shortcut key
  15.     min As Integer          'run minimized
  16. End Type
  17. 'used to transfer data between windows
  18. Global gItem As itemdata
  19.  
  20.  
  21.  
  22. Declare Function BitBlt% Lib "GDI" (ByVal hDestDC%, ByVal x%, ByVal y%, ByVal nWidth%, ByVal nHeight%, ByVal hSrcDC%, ByVal XSrc%, ByVal YSrc%, ByVal dwRop&)
  23. Declare Function DrawIcon% Lib "User" (ByVal hDC%, ByVal x%, ByVal y%, ByVal hIcon%)
  24. Declare Function ExtractIcon% Lib "shell.dll" (ByVal hisnt%, ByVal lpszExeName$, ByVal iIcon%)
  25. Declare Function GetWindowWord% Lib "User" (ByVal hWnd%, ByVal nIndex%)
  26.  
  27. Function GetFile (actn%, fndx%, act%) As String
  28. 't%=dialog type 'fn%=filterindex 'act%=action
  29. sample1.cd.Filter = "All Files(*.*)|*.*|Executable Files(*.hlp;*.exe)|*.hlp;*.exe|Graphic Files(*.bmp;*.ico)|*.bmp;*.ico"
  30. Select Case actn%
  31. Case 2'cap
  32.    sample1.cd.DialogTitle = "Save a Graphic File"
  33. Case 4'browse
  34.    sample1.cd.DialogTitle = "Browse"
  35. End Select
  36. sample1.cd.FilterIndex = fndx%
  37. On Error Resume Next
  38.    sample1.cd.Action = act%
  39.    GetFile = sample1.cd.Filename
  40.    If Err = 32755 Then GetFile = ""
  41. End Function
  42.  
  43. Sub RaiseForm (F As Form)
  44. Dim x%, y%
  45. If F.ScaleMode = 3 Then x = 1: y = 1 Else x = tx: y = ty
  46. F.Line (0, F.ScaleHeight - y)-(0, 0), QBColor(15)
  47. F.Line -(F.ScaleWidth - x, 0), QBColor(15)
  48. F.Line -(F.ScaleWidth - x, F.ScaleHeight - y), QBColor(8)
  49. F.Line -(0, F.ScaleHeight - y), QBColor(8)
  50. End Sub
  51.  
  52. Sub Sink (F As Form, c As Control)
  53. Dim l, t, r, B
  54. Dim x%, y%
  55. If F.ScaleMode = 3 Then x = 1: y = 1 Else x = tx: y = ty
  56.  
  57. l = c.Left - x: t = c.Top - y: r = c.Left + c.Width: B = c.Top + c.Height
  58. F.Line (l, B - y)-(l, t), QBColor(8)
  59. F.Line -(r, t), QBColor(8)
  60. F.Line -(r, B), QBColor(15)
  61. F.Line -(l - x, B), QBColor(15)
  62. End Sub
  63.  
  64.